var express = require('express');
var router = express.Router();

const {pushClaims,getClaims,modifyClaims,applyClaims,deleteClaims}=require('../service/claimsService')
/* GET home page. */
//销售员新增理赔订单
router.post('/pushClaims',async function(req, res, next) {
 const data=await pushClaims(req.body)
 res.send(data)
});

//销售员获取所有理赔订单
router.get('/getClaims',async function(req, res, next) {
    const data=await getClaims(req.query)
    res.send(data)
   });

//销售员修改理赔信息并提交
router.post('/modifyClaims',async function(req, res, next) {
    const data=await modifyClaims(req.body)
    res.send(data)
   });

   //管理员从处理理赔信息
router.post('/applyClaims',async function(req, res, next) {
    const data=await applyClaims(req.body)
    res.send(data)
   });

      //管理删除理理赔信息
router.post('/deleteClaims',async function(req, res, next) {
    const data=await deleteClaims(req.body)
    res.send(data)
   });
module.exports = router;
